Skip to content

fix(worker): handle HTTP dates in iLoveAPI Retry-After - #598

Open
xcosmosbox wants to merge 1 commit into
Ontos-AI:mainfrom
xcosmosbox:fix/xcosmosbox/iloveapi-retry-after
Open

xcosmosbox wants to merge 1 commit into
Ontos-AI:mainfrom
xcosmosbox:fix/xcosmosbox/iloveapi-retry-after

Conversation

@xcosmosbox

Copy link
Copy Markdown
Contributor

Summary

When iLoveAPI rate-limits a PPTX conversion, Retry-After can be an HTTP date. int() raised ValueError before the worker could cool down the token, masking the original HTTP error.

Read both delay-seconds and HTTP dates at all four conversion steps and in the HTTP-error handler. Missing or unreadable headers fall back to 60 seconds. Integer handling and the LibreOffice fallback are unchanged.

Verification

  • python -m pytest -q apps/worker/tests/unit/test_iloveapi_retry_after.py: 17 passed with synthetic settings and mocked HTTP and quota handling. Scope: header formats, rate limiting at each step, and successful conversion.
  • ruff check on the three changed files.

Deployment Notes

Worker only. No API, schema, queue, configuration, or release-order changes.

Checklist

  • Added regression tests.
  • Described the worker behavior and deployment impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant